

<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title>添加修改</title>
    {include file="include/top"}
    <style>
        .layui-form-item .layui-input-inline{width: 80%;}
        #LAY_layedit_2{background: #fff;}
    </style>
</head>
<body>

<div class="layui-form" lay-filter="layuiadmin-form-useradmin" id="layuiadmin-app-form-tags" style="padding: 20px 0 0 0;">
    <div class="layui-form-item">
        <label class="layui-form-label">类型</label>
        <div class="layui-input-inline">
            <select name="cid" lay-search="" lay-filter="cid" lay-search>
                <option value="1" <?php if(isset($data['status']) && $data['status']==1){ echo 'selected';}?>>油站标签</option>
                <option value="2" <?php if(isset($data['status']) && $data['status']==2){ echo 'selected';}?>>服务商标签</option>
            </select>
        </div>
    </div>

    {include file="include/input" class2='layui-form-item' type='text' title="标题" name='title' value='<?php echo isset($data["title"])?$data["title"]:"";?>'}
    {include file="include/input" class2='layui-form-item' type='text' title="备注" name='content' value='<?php echo isset($data["content"])?$data["content"]:"";?>'}

    <div class="layui-form-item">
        <label class="layui-form-label">状态</label>
        <div class="layui-input-inline">
            <select name="status" lay-search="" lay-filter="status" lay-search>
                <option value="1" <?php if(isset($data['status']) && $data['status']==1){ echo 'selected';}?>>正常</option>
                <option value="-1" <?php if(isset($data['status']) && $data['status']==-1){ echo 'selected';}?>>停用</option>
            </select>
        </div>
    </div>

</div>

{include file="include/js"}
<script>
    layui.config({
        base: '/layuiadmin/' //静态资源所在路径
    }).extend({
        index: 'lib/index' //主入口模块
    }).use(['index','form','layedit','upload'],function () {
        var $=layui.$;
        var form=layui.form;
        var upload = layui.upload
        var layedit = layui.layedit;
        // 图片接口放到建立编辑器前面，否则无效
        layedit.set({
            uploadImage: {
                url: '/users/uploadimg', //接口url
                type: 'post' //默认post
            }
        });
        // 设置编辑器
        layedit.build('content', {
            height: 500 //设置编辑器高度
            ,background:"#ffffff"
        });

        var index = layedit.build('content'); //建立编辑器
        form.verify({ // 这里就是把富文本数据同步到<textarea>中
            content: function (value) {
                return layedit.sync(index);
            }
        });
    });
</script>
</body>
</html>